import { defineStore } from "pinia";
const useMusic = defineStore("music", {
  state: () => ({
    musicList: [
      {
        songTitle: "Someone Like You",
        singer: "Adele",
        url: new URL("@/assets/audio/SomeoneLikeYou.mp3", import.meta.url).href,
        cover: new URL("../assets/background-music/cover1.png", import.meta.url)
          .href,
        iaActive: false,
      },
      {
        songTitle: "起风了",
        singer: "吴青峰",
        url: new URL("@/assets/audio/qifengle.mp3", import.meta.url).href,
        cover: new URL("@/assets/background-music/cover2.png", import.meta.url)
          .href,
        iaActive: false,
      },
      {
        songTitle: "我是如此相信",
        singer: "周杰伦",
        url: new URL("@/assets/audio/wsrcxx.mp3", import.meta.url).href,
        cover: new URL("@/assets/background-music/cover3.png", import.meta.url)
          .href,
        iaActive: false,
      },
      {
        songTitle: "止战之殇",
        singer: "周杰伦",
        url: new URL("@/assets/audio/zzzs.mp3", import.meta.url).href,
        cover: new URL("@/assets/background-music/cover4.png", import.meta.url)
          .href,
        iaActive: false,
      },
      {
        songTitle: "床边故事",
        singer: "周杰伦",
        url: new URL("@/assets/audio/cbgs.mp3", import.meta.url).href,
        cover: new URL("@/assets/background-music/cover5.png", import.meta.url)
          .href,
        iaActive: false,
      },
      {
        songTitle: "夜曲",
        singer: "周杰伦",
        url: new URL("@/assets/audio/yq.mp3", import.meta.url).href,
        cover: new URL("@/assets/background-music/cover6.png", import.meta.url)
          .href,
        iaActive: false,
      },
    ],
    activeMusicNum: 0,
    mp3: null,
    currentTime: "00:00",
    duration: "00:00",
    scale: 0,
    modeList: [
      {
        id: 1,
        mode: "列表循环",
        isActive: false,
        url: new URL(
          "../assets/background-music/list_loop.png",
          import.meta.url
        ).href,
      },
      {
        id: 2,
        mode: "随机循环",
        isActive: false,
        url: new URL(
          "../assets/background-music/random_loop.png",
          import.meta.url
        ).href,
      },
      {
        id: 3,
        mode: "单曲循环",
        isActive: false,
        url: new URL(
          "../assets/background-music/only_loop.png",
          import.meta.url
        ).href,
      },
    ],
    activeModeNum: 0,
  }),
  getters: {},
  actions: {},
});
export default useMusic;
